home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / ien / ien-123 < prev    next >
Text File  |  1988-12-01  |  82KB  |  2,709 lines

  1.  
  2.                                                            December 1979
  3.  
  4. IEN: 123
  5.                                     
  6.                                     
  7.                                     
  8.                                     
  9.                                     
  10.                                     
  11.                                     
  12.                               DOD STANDARD
  13.                                     
  14.                            INTERNET PROTOCOL
  15.                                     
  16.                                     
  17.                                     
  18.                              December 1979
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                               prepared for
  36.                                     
  37.                Defense Advanced Research Projects Agency
  38.                 Information Processing Techniques Office
  39.                          1400 Wilson Boulevard
  40.                        Arlington, Virginia  22209
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.                                    by
  49.  
  50.                      Information Sciences Institute
  51.                    University of Southern California
  52.                            4676 Admiralty Way
  53.                    Marina del Rey, California  90291
  54.  
  55. December 1979                                                           
  56.                                                        Internet Protocol
  57.  
  58.  
  59.  
  60.                            TABLE OF CONTENTS
  61.  
  62.     PREFACE ........................................................ iii
  63.  
  64. 1.  INTRODUCTION ..................................................... 1
  65.  
  66.   1.1  Motivation .................................................... 1
  67.   1.2  Scope ......................................................... 1
  68.   1.3  Interfaces .................................................... 1
  69.   1.4  Operation ..................................................... 2
  70.  
  71. 2.  OVERVIEW ......................................................... 5
  72.  
  73.   2.1  Relation to Other Protocols ................................... 5
  74.   2.2  Model of Operation ............................................ 5
  75.   2.3  Function Description .......................................... 7
  76.  
  77. 3.  SPECIFICATION ................................................... 11
  78.  
  79.   3.1  Internet Header Format ....................................... 11
  80.   3.2  Discussion ................................................... 22
  81.   3.3  Examples & Scenarios ......................................... 30
  82.   3.4  Interfaces ................................................... 34
  83.  
  84. GLOSSARY ............................................................ 37
  85.  
  86. REFERENCES .......................................................... 41
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.                                                                 [Page i]
  112.  
  113.  
  114.                                                            December 1979
  115. Internet Protocol
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. [Page ii]                                                               
  171.  
  172.  
  173. December 1979                                                           
  174.                                                        Internet Protocol
  175.  
  176.  
  177.  
  178.                                 PREFACE
  179.  
  180.  
  181.  
  182. This document specifies the DoD Standard Internet Protocol.  This
  183. document is based on four earlier editions of the ARPA Internet Protocol
  184. Specification, and the present text draws heavily from them.  There have
  185. been many contributors to this work both in terms of concepts and in
  186. terms of text.
  187.  
  188. This edition revises the details security, compartmentation, and
  189. precedence features of the internet protocol.
  190.  
  191.                                                            Jon Postel
  192.  
  193.                                                            Editor
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.                                                               [Page iii]
  230.  
  231.  
  232. December 1979 
  233. IEN: 123
  234. Replaces:  IENs 111,
  235. 80, 54, 44, 41, 28, 26
  236.  
  237.                               DOD STANDARD
  238.  
  239.                            INTERNET PROTOCOL
  240.  
  241.  
  242.  
  243.                             1.  INTRODUCTION
  244.  
  245. 1.1.  Motivation
  246.  
  247.   The Internet Protocol is designed for use in interconnected systems of
  248.   packet-switched computer communication networks.  Such a system has
  249.   been called a "catenet" [1].  The internet protocol provides for
  250.   transmitting blocks of data called datagrams from sources to
  251.   destinations, where sources and destinations are hosts identified by
  252.   fixed length addresses.  The internet protocol also provides for
  253.   fragmentation and reassembly of long datagrams, if necessary, for
  254.   transmission through "small packet" networks.
  255.  
  256. 1.2.  Scope
  257.  
  258.   The internet protocol is specifically limited in scope to provide the
  259.   functions necessary to deliver a package of bits (an internet
  260.   datagram) from a source to a destination over an interconnected system
  261.   of networks.  There are no mechanisms to promote data reliability,
  262.   flow control, sequencing, or other services commonly found in
  263.   host-to-host protocols.
  264.  
  265. 1.3.  Interfaces
  266.  
  267.   This protocol is called on by host-to-host protocols in an internet
  268.   environment.  This protocol calls on local network protocols to carry
  269.   the internet datagram to the next gateway or destination host.
  270.  
  271.   For example, a TCP module would call on the internet module to take a
  272.   TCP segment (including the TCP header and user data) as the data
  273.   portion of an internet datagram.  The TCP module would provide the
  274.   addresses and other parameters in the internet header to the internet
  275.   module as arguments of the call.  The internet module would then
  276.   create an internet datagram and call on the local network interface to
  277.   transmit the internet datagram.
  278.  
  279.   In the ARPANET case, for example, the internet module would call on a
  280.   local net module which would add the 1822 leader [2] to the internet
  281.   datagram creating an ARPANET message to transmit to the IMP.  The
  282.   ARPANET address would be derived from the internet address by the
  283.   local network interface and would be the address of some host in the
  284.   ARPANET, that host might be a gateway to other networks.
  285.  
  286.  
  287.  
  288.                                                                 [Page 1]
  289.  
  290.  
  291.                                                            December 1979
  292. Internet Protocol
  293. Introduction
  294.  
  295.  
  296.  
  297. 1.4.  Operation
  298.  
  299.   The internet protocol implements two basic functions:  addressing and
  300.   fragmentation.
  301.  
  302.   The internet modules use the addresses carried in the internet header
  303.   to transmit the internet datagram toward their destinations.  The
  304.   selection of a path for transmission is called routing.
  305.  
  306.   The internet modules use fields in the internet header to fragment and
  307.   reassemble internet datagrams when necessary for transmission through
  308.   "small packet" networks.
  309.  
  310.   The model of operation is that an internet module resides in each host
  311.   engaged in internet communication and in each gateway that
  312.   interconnects networks.  These modules share common rules for
  313.   interpreting address fields and for fragmenting and assembling
  314.   internet datagrams.  In addition, these modules (especially in
  315.   gateways) may have procedures for making routing decisions and other
  316.   functions.
  317.  
  318.   The internet protocol treats each internet datagram as an independent
  319.   entity unrelated to any other internet datagram.  There are no
  320.   connections or logical circuits (virtual or otherwise).
  321.  
  322.   The internet protocol uses four key mechanisms in providing its
  323.   service:  Type of Service, Time to Live, Options, and Header Checksum.
  324.  
  325.   The Type of Service is used to indicate the quality of the service
  326.   desired; this may be thought of as selecting among Interactive, Bulk,
  327.   or Real Time, for example.  The type of service is an abstract or
  328.   generalized set of parameters which characterize the service choices
  329.   provided in the networks that make up the internet.  This type of
  330.   service indication is to be used by gateways to select the actual
  331.   transmission parameters for a particular network, the network to be
  332.   used for the next hop, or the next gateway when routing an internet
  333.   datagram.
  334.  
  335.   The Time to Live is an indication of the lifetime of an internet
  336.   datagram.  It is set by the sender of the datagram and reduced at the
  337.   points along the route where it is processed.  If the time to live
  338.   reaches zero before the internet datagram reaches its destination, the
  339.   internet datagram is destroyed.  The time to live can be thought of as
  340.   a self destruct time limit.
  341.  
  342.   The Options provide for control functions needed or useful in some
  343.   situations but unnecessary for the most common communications.  The
  344.  
  345.  
  346.  
  347. [Page 2]                                                                
  348.  
  349.  
  350. December 1979                                                           
  351.                                                        Internet Protocol
  352.                                                             Introduction
  353.  
  354.  
  355.  
  356.   options include provisions for timestamps, error reports, and special
  357.   routing.
  358.  
  359.   The Header Checksum provides a verification that the information used
  360.   in processing internet datagram has been transmitted correctly.  The
  361.   data may contain errors.  If the header checksum fails, the internet
  362.   datagram is discarded at once by the entity which detects the error.
  363.  
  364.   The internet protocol does not provide a reliable communication
  365.   facility.  There are no acknowledgments either end-to-end or
  366.   hop-by-hop.  There is no error control for data, only a header
  367.   checksum.  There are no retransmissions.  There is no flow control.
  368.  
  369.   
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.                                                                 [Page 3]
  407.  
  408.  
  409.                                                            December 1979
  410. Internet Protocol
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465. [Page 4]                                                                
  466.  
  467.  
  468. December 1979                                                           
  469.                                                        Internet Protocol
  470.  
  471.  
  472.  
  473.                               2.  OVERVIEW
  474.  
  475. 2.1.  Relation to Other Protocols
  476.  
  477.   The following diagram illustrates the place of the internet protocol
  478.   in the protocol hierarchy:
  479.  
  480.                                     
  481.                  +------+ +-----+ +-----+       +-----+
  482.                  |Telnet| | FTP | |Voice|  ...  |     |
  483.                  +------+ +-----+ +-----+       +-----+
  484.                        |   |         |             |   
  485.                       +-----+     +-----+       +-----+
  486.                       | TCP |     | RTP |  ...  |     |
  487.                       +-----+     +-----+       +-----+
  488.                          |           |             |   
  489.                       +-------------------------------+
  490.                       |       Internet Protocol       |
  491.                       +-------------------------------+
  492.                                      |                 
  493.                         +---------------------------+  
  494.                         |   Local Network Protocol  |  
  495.                         +---------------------------+  
  496.                                      |                 
  497.  
  498.  
  499.  
  500.                          Protocol Relationships
  501.  
  502.                                Figure 1.
  503.  
  504.   Internet protocol interfaces on one side to the higher level
  505.   host-to-host protocols and on the other side to the local network
  506.   protocol.
  507.  
  508. 2.2.  Model of Operation
  509.  
  510.   The  model of operation for transmitting a datagram from one
  511.   application program to another is illustrated by the following
  512.   scenario:
  513.  
  514.     We suppose that this transmission will involve one intermediate
  515.     gateway.
  516.  
  517.     The sending application program prepares its data and calls on its
  518.     local internet module to send that data as a datagram and passes the
  519.     destination address and other parameters as arguments of the call.
  520.  
  521.     The internet module prepares a datagram header and attaches the data
  522.  
  523.  
  524.                                                                 [Page 5]
  525.  
  526.  
  527.                                                            December 1979
  528. Internet Protocol
  529. Overview
  530.  
  531.  
  532.  
  533.     to it.  The internet module determines a local network address for
  534.     this internet address, in this case it is the address of a gateway.
  535.     It sends this datagram and the local network address to the local
  536.     network interface.
  537.  
  538.     The local network interface creates a local network header, and
  539.     attaches the datagram to it, then sends the result via the local
  540.     network.
  541.  
  542.     The datagram arrives at a gateway host wrapped in the local network
  543.     header, the local network interface strips off this header, and
  544.     turns the datagram over to the internet module.  The internet module
  545.     determines from the internet address that the datagram should be
  546.     forwarded to another host in a second network.  The internet module
  547.     determines a local net address for the destination host.  It calls
  548.     on the local network interface for that network to send the
  549.     datagram.
  550.  
  551.     This local network interface creates a local network header and
  552.     attaches the datagram sending the result to the destination host.
  553.  
  554.     At this destination host the datagram is stripped of the local net
  555.     header by the local network interface and handed to the internet
  556.     module.
  557.  
  558.     The internet module determines that the datagram is for an
  559.     application program in this host.  It passes the data to the
  560.     application program in response to a system call, passing the source
  561.     address and other parameters as results of the call.
  562.  
  563.                                     
  564.    Application                                           Application
  565.    Program                                                   Program
  566.          \                                                   /      
  567.        Internet Module      Internet Module      Internet Module    
  568.              \                 /       \                /           
  569.              LNI-1          LNI-1      LNI-2         LNI-2          
  570.                 \           /             \          /              
  571.                Local Network 1           Local Network 2            
  572.  
  573.  
  574.  
  575.                             Transmission Path
  576.  
  577.                                 Figure 2
  578.  
  579.  
  580.  
  581.  
  582.  
  583. [Page 6]                                                                
  584.  
  585.  
  586. December 1979                                                           
  587.                                                        Internet Protocol
  588.                                                                 Overview
  589.  
  590.  
  591.  
  592. 2.3.  Function Description
  593.  
  594.   The function or purpose of Internet Protocol is to move datagrams
  595.   through an interconnected set of networks.  This is done by passing
  596.   the datagrams from one internet module to another until the
  597.   destination is reached.  The internet modules reside in hosts and
  598.   gateways in the internet system.  The datagrams are routed from one
  599.   internet module to another through individual networks based on the
  600.   interpretation of an internet address.  Thus, one important mechanism
  601.   of the internet protocol is the internet address.
  602.  
  603.   In the routing of messages from one internet module to another,
  604.   datagrams may need to traverse a network whose maximum packet size is
  605.   smaller than the size of the datagram.  To overcome this difficulty, a
  606.   fragmentation mechanism is provided in the internet protocol.
  607.  
  608.   Addressing
  609.  
  610.     A distinction is made between names, addresses, and routes [3].   A
  611.     name indicates what we seek.  An address indicates where it is.  A
  612.     route indicates how to get there.  The internet protocol deals
  613.     primarily with addresses.  It is the task of higher level (i.e.,
  614.     host-to-host or application) protocols to make the mapping from
  615.     names to addresses.   The internet module maps internet addresses to
  616.     local net addresses.  It is the task of lower level (i.e., local net
  617.     or gateways) procedures to make the mapping from local net addresses
  618.     addresses to routes.
  619.  
  620.     Addresses are fixed length of four octets (32 bits).  An address
  621.     begins with a one octet network number, followed by a three octet
  622.     local address.  This three octet field is called the "rest" field.
  623.  
  624.     Care must be taken in mapping internet addresses to local net
  625.     addresses; a single physical host must be able to act as if it were
  626.     several distinct hosts to the extent of using several distinct
  627.     internet addresses.  A host should also be able to have several
  628.     physical interfaces (multi-homing).
  629.  
  630.     That is, a host should be allowed several physical interfaces to the
  631.     network with each having several logical internet addresses.
  632.  
  633.     Examples of address mappings may be found in reference [4].
  634.  
  635.   Fragmentation
  636.  
  637.     Fragmentation of an internet datagram may be necessary when it
  638.     originates in a local net that allows a large packet size and must
  639.  
  640.  
  641.  
  642.                                                                 [Page 7]
  643.  
  644.  
  645.                                                            December 1979
  646. Internet Protocol
  647. Overview
  648.  
  649.  
  650.  
  651.     traverse a local net that limits packets to a smaller size to reach
  652.     its destination.
  653.  
  654.     An internet datagram can be marked "don't fragment."  Any internet
  655.     datagram so marked is not to be internet fragmented under any
  656.     circumstances.  If internet datagram marked don't fragment cannot be
  657.     delivered to its destination without fragmenting it, it is to be
  658.     discarded instead.
  659.  
  660.     Fragmentation, transmission and reassembly across a local network
  661.     which is invisible to the internet protocol module is called
  662.     intranet fragmentation and may be used [5].
  663.  
  664.     The internet fragmentation and reassembly procedure needs to be able
  665.     to break a datagram into an almost arbitrary number of pieces that
  666.     can be later reassembled.  The receiver of the fragments uses the
  667.     identification field to ensure that fragments of different datagrams
  668.     are not mixed.  The fragment offset field tells the receiver the
  669.     position of a fragment in the original datagram.  The fragment
  670.     offset and length determine the portion of the original datagram
  671.     covered by this fragment.  The more-fragments flag indicates (by
  672.     being reset) the last fragment.  These fields provide sufficient
  673.     information to reassemble datagrams.
  674.  
  675.     The identification field is used to distinguish the fragments of one
  676.     datagram from those of another.  The originating protocol module of
  677.     an internet datagram sets the identification field to a value that
  678.     must be unique for that source-destination pair and protocol for the
  679.     time the datagram will be active in the internet system.  The
  680.     originating protocol module of a complete datagram sets the
  681.     more-fragments flag to zero and the fragment offset to zero.
  682.  
  683.     To fragment a long internet datagram, an internet protocol module
  684.     (for example, in a gateway), creates two new internet datagrams and
  685.     copies the contents of the internet header fields from the long
  686.     datagram into both new internet headers.  The data of the long
  687.     datagram is divided into two portions on a 8 octet (64 bit) boundary
  688.     (the second portion might not be an integral multiple of 8 octets,
  689.     but the first must be).  Call the number of 8 octet blocks in the
  690.     first portion NFB (for Number of Fragment Blocks).  The first
  691.     portion of the data is placed in the first new internet datagram,
  692.     and the total length field is set to the length of the first
  693.     datagram.  The more-fragments flag is set to one.  The second
  694.     portion of the data is placed in the second new internet datagram,
  695.     and the total length field is set to the length of the second
  696.     datagram.  The more-fragments flag carries the same value as the
  697.     long datagram.  The fragment offset field of the second new internet
  698.  
  699.  
  700.  
  701. [Page 8] 
  702.  
  703.  
  704. December 1979 
  705.                                                        Internet Protocol
  706.                                                                 Overview
  707.  
  708.  
  709.  
  710.     datagram is set to the value of that field in the long datagram plus
  711.     NFB.
  712.  
  713.     This procedure can be generalized for an n-way split, rather than
  714.     the two-way split described.
  715.  
  716.     To assemble the fragments of an internet datagram, an internet
  717.     protocol module (for example at a destination host) combines
  718.     internet datagram that all have the same value for the four fields:
  719.     identification, source, destination, and protocol.  The combination
  720.     is done by placing the data portion of each fragment in the relative
  721.     position indicated by the fragment offset in that fragment's
  722.     internet header.  The first fragment will have the fragment offset
  723.     zero, and the last fragment will have the more-fragments flag reset
  724.     to zero.
  725.  
  726.     
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.                                                                 [Page 9]
  761.  
  762.  
  763.                                                            December 1979
  764. Internet Protocol
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819. [Page 10]                                                               
  820.  
  821.  
  822. December 1979                                                           
  823.                                                        Internet Protocol
  824.  
  825.  
  826.  
  827.                            3.  SPECIFICATION
  828.  
  829. 3.1.  Internet Header Format
  830.  
  831.   A summary of the contents of the internet header follows:
  832.  
  833.                                     
  834.     0                   1                   2                   3   
  835.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
  836.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  837.    |Version|  IHL  |Type of Service|          Total Length         |
  838.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  839.    |         Identification        |Flags|      Fragment Offset    |
  840.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  841.    |  Time to Live |    Protocol   |         Header Checksum       |
  842.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  843.    |                       Source Address                          |
  844.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  845.    |                    Destination Address                        |
  846.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  847.    |                    Options                    |    Padding    |
  848.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  849.  
  850.                     Example Internet Datagram Header
  851.  
  852.                                Figure 3.
  853.  
  854.   Note that each tick mark represents one bit position.
  855.  
  856.   Version:  4 bits
  857.  
  858.     The Version field indicates the format of the internet header.  This
  859.     document describes version 4.
  860.  
  861.   IHL:  4 bits
  862.  
  863.     Internet Header Length is the length of the internet header in 32
  864.     bit words, and thus points to the beginning of the data.  Note that
  865.     the minimum value for a correct header is 5.
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.                                                                [Page 11]
  879.  
  880.  
  881.                                                            December 1979
  882. Internet Protocol
  883. Specification
  884.  
  885.  
  886.  
  887.   Type of Service:  8 bits
  888.  
  889.     The Type of Service provides an indication of the abstract
  890.     parameters of the quality of service desired.  These parameters are
  891.     to be used to guide the selection of the actual service parameters
  892.     when transmitting a datagram through a particular network.  Several
  893.     networks offer service precedence, which somehow treats high
  894.     precedence traffic as more important than other traffic.  A few
  895.     networks offer a Stream service, whereby one can achieve a smoother
  896.     service at some cost.  Typically this involves the reservation of
  897.     resources within the network.  Another choice involves a low-delay
  898.     vs. high-reliability trade off.  Typically networks invoke more
  899.     complex (and delay producing) mechanisms as the need for reliability
  900.     increases.
  901.  
  902.       Bits 0-2:  Priority.
  903.       Bit    3:  Stream or Datagram.
  904.       Bits 4-5:  Reliability.
  905.       Bit    6:  Speed over Reliability.
  906.       Bits   7:  Speed.
  907.  
  908.          0     1     2     3     4     5     6     7
  909.       +-----+-----+-----+-----+-----+-----+-----+-----+
  910.       |                 |     |           |     |     |
  911.       |   PRECEDENCE    | STRM|RELIABILITY| S/R |SPEED|
  912.       |                 |     |           |     |     |
  913.       +-----+-----+-----+-----+-----+-----+-----+-----+
  914.  
  915.       PRECEDENCE          STRM      RELIABILITY  S/R      SPEED
  916.       111-Flash Override  1-STREAM  11-highest   1-speed  1-high
  917.       110-Flash           0-DTGRM   10-higher    0-rlblt  0-low
  918.       11X-Immediate                 01-lower
  919.       01X-Priority                  00-lowest
  920.       00X-Routine
  921.  
  922.     The type of service is used to specify the treatment of the datagram
  923.     during its transmission through the internet system.  In the
  924.     discussion (section 3.2) below, a chart shows the relationship of
  925.     the internet type of service to the actual service provided on the
  926.     ARPANET, the SATNET, and the PRNET.
  927.  
  928.   Total Length:  16 bits
  929.  
  930.     Total Length is the length of the datagram, measured in octets,
  931.     including internet header and data.  This field allows the length of
  932.     a datagram to be up to 65,535 octets.  Such long datagrams are
  933.     impractical for most hosts and networks.  All hosts must be prepared
  934.     to accept datagrams of up to 576 octets (whether they arrive whole
  935.  
  936.  
  937. [Page 12]                                                               
  938.  
  939.  
  940. December 1979                                                           
  941.                                                        Internet Protocol
  942.                                                            Specification
  943.  
  944.  
  945.  
  946.     in fragments).  It is recommended that hosts only send datagrams
  947.     larger than 576 octets if they have assurance that the destination
  948.     is prepared to accept the larger datagrams.
  949.  
  950.     The number 576 is selected to allow a reasonable sized data block to
  951.     be transmitted in addition to the required header information.  For
  952.     example, this size allows a data block of 512 octets plus 64 header
  953.     octets to fit in a datagram.  The maximal internet header is 60
  954.     octets, and a typical internet header is 20 octets, allowing a
  955.     margin for headers of higher level protocols.
  956.  
  957.   Identification:  16 bits
  958.  
  959.     An identifying value assigned by the sender to aid in assembling the
  960.     fragments of a datagram.
  961.  
  962.   Flags:  3 bits
  963.  
  964.     Various Control Flags.
  965.  
  966.       Bit 0: reserved, must be zero
  967.       Bit 1: Don't Fragment This Datagram (DF).
  968.       Bit 2: More Fragments Flag (MF).
  969.  
  970.           0   1   2
  971.         +---+---+---+
  972.         |   | D | M |
  973.         | 0 | F | F |
  974.         +---+---+---+
  975.  
  976.   Fragment Offset:  13 bits
  977.  
  978.     This field indicates where in the datagram this fragment belongs.
  979.     The fragment offset is measured in units of 8 octets (64 bits).  The
  980.     first fragment has offset zero.
  981.  
  982.   Time to Live:  8 bits
  983.  
  984.     This field indicates the maximum time the datagram is allowed to
  985.     remain the internet system.  If this field contains the value zero,
  986.     then the datagram should be destroyed.  This field is modified in
  987.     internet header processing.  The time is measured in units of
  988.     seconds.  The intention is to cause undeliverable datagrams to be
  989.     discarded.
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.                                                                [Page 13]
  997.  
  998.  
  999.                                                            December 1979
  1000. Internet Protocol
  1001. Specification
  1002.  
  1003.  
  1004.  
  1005.   Protocol:  8 bits
  1006.  
  1007.     This field indicates the next level protocol used in the data
  1008.     portion of the internet datagram.  The values for various protocols
  1009.     are specified in reference [6].
  1010.  
  1011.   Header Checksum:  16 bits
  1012.  
  1013.     A checksum on the header only.  Since some header fields may change
  1014.     (e.g., time to live), this is recomputed and verified at each point
  1015.     that the internet header is processed.
  1016.  
  1017.     The checksum algorithm is:
  1018.  
  1019.       The checksum field is the 16 bit one's complement of the one's
  1020.       complement sum of all 16 bit words in the header.  For purposes of
  1021.       computing the checksum, the value of the checksum field is zero.
  1022.  
  1023.     This is a simple to compute checksum and experimental evidence
  1024.     indicates it is adequate, but it is provisional and may be replaced
  1025.     by a CRC procedure, depending on further experience.
  1026.  
  1027.   Source Address:  32 bits
  1028.  
  1029.     The source address.  The first octet is the Source Network, and the
  1030.     following three octets are the Source Local Address.
  1031.  
  1032.   Destination Address:  32 bits
  1033.  
  1034.     The destination address.  The first octet is the Destination
  1035.     Network, and the following three octets are the Destination Local
  1036.     Address.
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055. [Page 14]                                                               
  1056.  
  1057.  
  1058. December 1979                                                           
  1059.                                                        Internet Protocol
  1060.                                                            Specification
  1061.  
  1062.  
  1063.  
  1064.   Options:  variable
  1065.  
  1066.     The option field is variable in length.  There may be zero or more
  1067.     options.  There are two case for the format of an option:
  1068.  
  1069.       Case 1:  A single octet of option-type.
  1070.  
  1071.       Case 2:  An option-type octet, an option-length octet, and the
  1072.                actual option-data octets.
  1073.  
  1074.     The option-length octet counts the option-type octet and the
  1075.     option-length octet as well as the option-data octets.
  1076.  
  1077.     The option-type octet is viewed as having 3 fields:
  1078.  
  1079.       1 bit   reserved, must be zero
  1080.       2 bits  option class,
  1081.       5 bits  option number.
  1082.  
  1083.     The option classes are:
  1084.  
  1085.       0 = control
  1086.       1 = internet error
  1087.       2 = experimental debugging and measurement
  1088.       3 = reserved for future use
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.                                                                [Page 15]
  1115.  
  1116.  
  1117.                                                            December 1979
  1118. Internet Protocol
  1119. Specification
  1120.  
  1121.  
  1122.  
  1123.     The following internet options are defined:
  1124.  
  1125.       CLASS NUMBER LENGTH DESCRIPTION
  1126.       ----- ------ ------ -----------
  1127.         0     0      -    End of Option list.  This option occupies only
  1128.                           1 octet; it has no length octet.
  1129.         0     1      -    No Operation.  This option occupies only 1
  1130.                           octet; it has no length octet.
  1131.         0     2      4    Security.  Used to carry Security, and user
  1132.                           group (TCC) information compatible with DOD
  1133.                           requirements.
  1134.         0     3     var.  Source Routing.  Used to route the internet
  1135.                           datagram based on information supplied by the
  1136.                           source.
  1137.         0     4     var.  BCR Open.
  1138.         0     5     var.  BCR Close.
  1139.         0     6     var.  BCR other.
  1140.         0     7     var.  Return Route.  Used to record the route an
  1141.                           internet datagram takes.
  1142.         0     8      4    Stream ID.  Used to carry the stream
  1143.                           identifier.
  1144.         1     1     var.  General Error Report.  Used to report errors
  1145.                           in internet datagram processing.
  1146.         2     4      6    Internet Timestamp.  Used to accumulate
  1147.                           timestamping information during internet
  1148.                           transit.  The length field is variable and may
  1149.                           change as the internet datagram traverses the
  1150.                           networks and gateways of the internet system.
  1151.         2     5      6    Satellite Timestamp.  Used as above for
  1152.                           special satellite network testing.
  1153.  
  1154.       
  1155.  
  1156.     Specific Option Definitions
  1157.  
  1158.       End of Option List
  1159.  
  1160.         +--------+
  1161.         |00000000|
  1162.         +--------+
  1163.           Type=0
  1164.  
  1165.         This option indicates the end of the option list.  This might
  1166.         not coincide with the end of the internet header according to
  1167.         the internet header length.  This is used at the end of all
  1168.         options, not the end of each option, and need only be used if
  1169.         the end of the options would not otherwise coincide with the end
  1170.         of the internet header.
  1171.  
  1172.  
  1173. [Page 16]                                                               
  1174.  
  1175.  
  1176. December 1979                                                           
  1177.                                                        Internet Protocol
  1178.                                                            Specification
  1179.  
  1180.  
  1181.  
  1182.         May be copied, introduced, or deleted on fragmentation.
  1183.  
  1184.       No Operation
  1185.  
  1186.         +--------+
  1187.         |00000001|
  1188.         +--------+
  1189.           Type=1
  1190.  
  1191.         This option may be used between options, for example, to align
  1192.         the beginning of a subsequent option on a 32 bit boundary.
  1193.  
  1194.         May be copied, introduced, or deleted on fragmentation.
  1195.  
  1196.       Security
  1197.  
  1198.         This option provides a way for DOD hosts to send security and
  1199.         TCC (closed user groups) parameters through networks whose
  1200.         transport leader does not contain fields for this information.
  1201.         The format for this option is as follows:
  1202.  
  1203.           +--------+--------+---------+--------+
  1204.           |00000010|00000100|000000SS |  TCC   |
  1205.           +--------+--------+---------+--------+
  1206.             Type=2  Length=4
  1207.  
  1208.         Security:  2 bits
  1209.  
  1210.           Specifies one of 4 levels of security
  1211.  
  1212.             11-top secret
  1213.             10-secret
  1214.             01-confidential
  1215.             00-unclassified
  1216.  
  1217.         Transmission Control Code:  8 bits
  1218.  
  1219.           Provides a means to compartmentalize traffic and define
  1220.           controlled communities of interest among subscribers.
  1221.  
  1222.         Note that this option does not require processing by the
  1223.         internet module but does require that this information be passed
  1224.         to higher level protocol modules.  The security and TCC
  1225.         information might be used to supply class level and compartment
  1226.         information for transmitting datagrams into or through
  1227.         AUTODIN II.
  1228.  
  1229.         Must be copied on fragmentation.
  1230.  
  1231.  
  1232.                                                                [Page 17]
  1233.  
  1234.  
  1235.                                                            December 1979
  1236. Internet Protocol
  1237. Specification
  1238.  
  1239.  
  1240.  
  1241.       Source Route
  1242.  
  1243.         +--------+--------+--------+---------//--------+
  1244.         |00000011| length |        source route        |
  1245.         +--------+--------+--------+---------//--------+
  1246.           Type=3
  1247.  
  1248.         The source route option provides a means for the source of an
  1249.         internet datagram to supply routing information to be used by
  1250.         the gateways in forwarding the datagram to the destination.
  1251.  
  1252.         The option begins with the option type code.  The second octet
  1253.         is the option length which includes the option type code and the
  1254.         length octet, as well as length-2 octets of source route data.
  1255.  
  1256.         A source route is composed of a series of internet addresses.
  1257.         Each internet address is 32 bits or 4 octets.  The length
  1258.         defaults to two, which indicates the source route is empty and
  1259.         the remaining routing is to be based on the destination address
  1260.         field.
  1261.  
  1262.         If the address in destination address field has been reached and
  1263.         this option's length is not two, the next address in the source
  1264.         route replaces the address in the destination address field, and
  1265.         is deleted from the source route and this option's length is
  1266.         reduced by four.  (The Internet Header Length Field must be
  1267.         changed also.)
  1268.  
  1269.         Must be copied on fragmentation.
  1270.  
  1271.       Return Route
  1272.  
  1273.         +--------+--------+--------+---------//--------+
  1274.         |00000111| length |        return route        |
  1275.         +--------+--------+--------+---------//--------+
  1276.           Type=7
  1277.  
  1278.         The return route option provides a means to record the route of
  1279.         an internet datagram.
  1280.  
  1281.         The option begins with the option type code.  The second octet
  1282.         is the option length which includes the option type code and the
  1283.         length octet, as well as length-2 octets of return route data.
  1284.  
  1285.         A return route is composed of a series of internet addresses.
  1286.         The length defaults to two, which indicates the return route is
  1287.         empty.
  1288.  
  1289.  
  1290.  
  1291. [Page 18]                                                               
  1292.  
  1293.  
  1294. December 1979                                                           
  1295.                                                        Internet Protocol
  1296.                                                            Specification
  1297.  
  1298.  
  1299.  
  1300.         When an internet module routes a datagram it checks to see if
  1301.         the return route option is present.  If it is, it inserts its
  1302.         own internet address as known in the environment into which this
  1303.         datagram is being forwarded into the return route at the front
  1304.         of the address string and increments the length by four.
  1305.  
  1306.         Not copied on fragmentation, goes in first fragment only.
  1307.  
  1308.       BCR Options
  1309.  
  1310.         BCR OPEN
  1311.  
  1312.         +--------+--------+------
  1313.         |00000100| length | data 
  1314.         +--------+--------+------
  1315.           Type=4
  1316.  
  1317.         BCR CLOSE
  1318.  
  1319.         +--------+--------+------
  1320.         |00000101| length | data 
  1321.         +--------+--------+------
  1322.           Type=5
  1323.  
  1324.         BCR OTHER
  1325.  
  1326.         +--------+--------+------
  1327.         |00000110| length | data 
  1328.         +--------+--------+------
  1329.           Type=6
  1330.  
  1331.         These options are used with the BCR.
  1332.  
  1333.         These options are not copied on fragmentation, they are carried
  1334.         only in the first fragment.
  1335.  
  1336.       Stream Identifier
  1337.  
  1338.         +--------+--------+---------+--------+
  1339.         |00001000|00000010|     Stream ID    |
  1340.         +--------+--------+---------+--------+
  1341.           Type=8  Length=4
  1342.  
  1343.         This option provides a way for the 16-bit SATNET stream
  1344.         identifier to be carried through networks that do not support
  1345.         the stream concept.
  1346.  
  1347.         Must be copied on fragmentation.
  1348.  
  1349.  
  1350.                                                                [Page 19]
  1351.  
  1352.  
  1353.                                                            December 1979
  1354. Internet Protocol
  1355. Specification
  1356.  
  1357.  
  1358.  
  1359.       General Error Report
  1360.  
  1361.         +--------+--------+--------+--------+--------+----//----+
  1362.         |00100001| length |err code|        id       |          |
  1363.         +--------+--------+--------+--------+--------+----//----+
  1364.          Type=33
  1365.  
  1366.         The general error report is used to report an error detected in
  1367.         processing an internet datagram to the source internet module of
  1368.         that datagram.  The "err code" indicates the type of error
  1369.         detected, and the "id" is copied from the identification field
  1370.         of the datagram in error, additional octets of error information
  1371.         may be present depending on the err code.
  1372.  
  1373.         If an internet datagram containing the general error report
  1374.         option is found to be in error or must be discarded, no error
  1375.         report is sent.
  1376.  
  1377.         ERR CODE:
  1378.  
  1379.           0 - Undetermined Error, used when no information is available
  1380.           about the type of error or the error does not fit any defined
  1381.           class.  Following the id should be as much of the datagram
  1382.           (starting with the internet header) as fits in the option
  1383.           space.
  1384.  
  1385.           1 - Datagram Discarded, used when specific information is
  1386.           available about the reason for discarding the datagram can be
  1387.           reported.  Following the id should be the original (4-octets)
  1388.           destination address, and the (1-octet) reason.
  1389.  
  1390.             Reason   Description
  1391.             ------   -----------
  1392.                0     No Reason
  1393.                1     No One Wants It - No higher level protocol or
  1394.                      application program at destination wants this
  1395.                      datagram.
  1396.                2     Fragmentation Needed & DF - Cannot deliver with out
  1397.                      fragmenting and has don't fragment bit set.
  1398.                3     Reassembly Problem - Destination could not
  1399.                      reassemble due to missing fragments when time to
  1400.                      live expired.
  1401.                4     Gateway Congestion - Gateway discarded datagram due
  1402.                      to congestion.
  1403.  
  1404.         The error report is placed in a datagram with the following
  1405.         values in the internet header fields:
  1406.  
  1407.  
  1408.  
  1409. [Page 20]                                                               
  1410.  
  1411.  
  1412. December 1979                                                           
  1413.                                                        Internet Protocol
  1414.                                                            Specification
  1415.  
  1416.  
  1417.  
  1418.           Version:  Same as the datagram in error.
  1419.           IHL:  As computed.
  1420.           Type of Service:  Zero.
  1421.           Total Length:  As computed.
  1422.           Identification:  A new identification is selected.
  1423.           Flags:  Zero.
  1424.           Fragment Offset:  Zero.
  1425.           Time to Live:  Sixty.
  1426.           Protocol:  Same as the datagram in error.
  1427.           Header Checksum:  As computed.
  1428.           Source Address:  Address of the error reporting module.
  1429.           Destination Address:  Source address of the datagram in error.
  1430.           Options:  The General Error Report Option.
  1431.           Padding:  As needed.
  1432.  
  1433.         Not copied on fragmentation, goes with first fragment.
  1434.  
  1435.       Internet Timestamp
  1436.  
  1437.         +--------+--------+--------+--------+--------+--------+
  1438.         |01000100|00000100|        time in milliseconds       |
  1439.         +--------+--------+--------+--------+--------+--------+
  1440.          Type=68  Length=6
  1441.  
  1442.         The data of the timestamp is a 32 bit time measured in
  1443.         milliseconds.
  1444.  
  1445.         Not copied on fragmentation, goes with first fragment
  1446.  
  1447.       Satellite Timestamp
  1448.  
  1449.         +--------+--------+--------+--------+--------+--------+
  1450.         |01000101|00000100|        time in milliseconds       |
  1451.         +--------+--------+--------+--------+--------+--------+
  1452.          Type=69  Length=6
  1453.  
  1454.         The data of the timestamp is a 32 bit time measured in
  1455.         milliseconds.
  1456.  
  1457.         Not copied on fragmentation, goes with first fragment
  1458.  
  1459.   Padding:  variable
  1460.  
  1461.     The internet header padding is used to ensure that the internet
  1462.     header ends on a 32 bit boundary.  The padding is zero.
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.                                                                [Page 21]
  1469.  
  1470.  
  1471.                                                            December 1979
  1472. Internet Protocol
  1473. Specification
  1474.  
  1475.  
  1476.  
  1477. 3.2.  Discussion
  1478.  
  1479.   The implementation of a protocol must be robust.  Each implementation
  1480.   must expect to interoperate with others created by different
  1481.   individuals.  While the goal of this specification is to be explicit
  1482.   about the protocol there is the possibility of differing
  1483.   interpretations.  In general, an implementation should be conservative
  1484.   in its sending behavior, and liberal in its receiving behavior.  That
  1485.   is, it should be careful to send well-formed datagrams, but should
  1486.   accept any datagram that it can interpret (e.g., not object to
  1487.   technical errors where the meaning is still clear).
  1488.  
  1489.   The basic internet service is datagram oriented and provides for the
  1490.   fragmentation of datagrams at gateways, with reassembly taking place
  1491.   at the destination internet protocol module in the destination host.
  1492.   Of course, fragmentation and reassembly of datagrams within a network
  1493.   or by private agreement between the gateways of a network is also
  1494.   allowed since this is transparent to the internet protocols and the
  1495.   higher-level protocols.  This transparent type of fragmentation and
  1496.   reassembly is termed "network-dependent" (or intranet) fragmentation
  1497.   and is not discussed further here.
  1498.  
  1499.   Internet addresses distinguish sources and destinations to the host
  1500.   level and provide a protocol field as well.  It is assumed that each
  1501.   protocol will provide for whatever multiplexing is necessary within a
  1502.   host.
  1503.  
  1504.   Addressing
  1505.  
  1506.     The 8 bit network number, which is the first octet of the address,
  1507.     has a value as specified in reference [6].
  1508.  
  1509.     The 24 bit local address, assigned by the local network, should
  1510.     allow for a single physical host to act as several distinct internet
  1511.     hosts.  That is, there should be mapping between internet host
  1512.     addresses and network/host interfaces that allows several internet
  1513.     addresses to correspond to one interface.  It should also be allowed
  1514.     for a host to have several physical interfaces and to treat the
  1515.     datagrams from several of them as if they were all addressed to a
  1516.     single host.  Address mappings between internet addresses and
  1517.     addresses for ARPANET, SATNET, PRNET, and other networks are
  1518.     described in reference [4].
  1519.  
  1520.   Fragmentation and Reassembly.
  1521.  
  1522.     The internet identification field (ID) is used together with the
  1523.     source and destination address, and the protocol fields, to identify
  1524.     datagram fragments for reassembly.
  1525.  
  1526.  
  1527. [Page 22]                                                               
  1528.  
  1529.  
  1530. December 1979                                                           
  1531.                                                        Internet Protocol
  1532.                                                            Specification
  1533.  
  1534.  
  1535.  
  1536.     The More Fragments flag bit (MF) is set if the datagram is not the
  1537.     last fragment.  The Fragment Offset field identifies the fragment
  1538.     location, relative to the beginning of the original unfragmented
  1539.     datagram.  Fragments are counted in units of 8 octets.  The
  1540.     fragmentation strategy is designed so than an unfragmented datagram
  1541.     has all zero fragmentation information (MF = 0, fragment offset =
  1542.     0).  If an internet datagram is fragmented, its data portion must be
  1543.     broken on 8 octet boundaries.
  1544.  
  1545.     This format allows 2**13 = 8192 fragments of 8 octets each for a
  1546.     total of 65,536 octets.  Note that this is consistent with the the
  1547.     datagram total length field.
  1548.  
  1549.     When fragmentation occurs, options some are not copied, but others
  1550.     remain with the first fragment only.
  1551.  
  1552.     Every internet module must be able to forward a datagram of 68
  1553.     octets without further fragmentation.  This is because an internet
  1554.     header may be up to 60 octets, and the minimum fragment is 8 octets.
  1555.  
  1556.     Every internet destination must be able to receive a datagram of 576
  1557.     octets either in one piece or in fragments to be reassembled.
  1558.  
  1559.     The fields which may be affected by fragmentation include:
  1560.  
  1561.       (1) options field
  1562.       (2) more fragments flag
  1563.       (3) fragment offset
  1564.       (4) internet header length field
  1565.       (5) total length field
  1566.       (6) header checksum
  1567.  
  1568.     If the Don't Fragment flag (DF) bit is set, then internet
  1569.     fragmentation of this datagram is NOT permitted, although it may be
  1570.     discarded.  This can be used to prohibit fragmentation in cases
  1571.     where the receiving host does not have sufficient resources to
  1572.     reassemble internet fragments.
  1573.  
  1574.     General notation in the following pseudo programs: "=<" means "less
  1575.     than or equal", "#" means "not equal", "=" means "equal", "<-" means
  1576.     "is set to".  Also, "x to y" includes x and excludes y; for example,
  1577.     "4 to 7" would include 4, 5, and 6 (but not 7).
  1578.  
  1579.     Fragmentation Procedure
  1580.  
  1581.       The maximum sized message that can be transmitted through the next
  1582.       network is called the maximum transmission unit (MTU).
  1583.  
  1584.  
  1585.  
  1586.                                                                [Page 23]
  1587.  
  1588.  
  1589.                                                            December 1979
  1590. Internet Protocol
  1591. Specification
  1592.  
  1593.  
  1594.  
  1595.       If the total length is less than or equal the maximum transmission
  1596.       unit then submit this datagram to the next step in datagram
  1597.       processing; otherwise cut the datagram into two fragments, the
  1598.       first fragment being the maximum size (modulo the fragment block
  1599.       size), and the second fragment being the rest of the datagram.
  1600.       The first fragment is submitted to the next step in datagram
  1601.       processing, while the second fragment is submitted to this
  1602.       procedure in case it still too large.
  1603.  
  1604.       Notation:
  1605.  
  1606.         FO    -  Fragment Offset
  1607.         IHL   -  Internet Header Length
  1608.         MF    -  More Fragments flag
  1609.         TL    -  Total Length
  1610.         OFO   -  Old Fragment Offset
  1611.         OIHL  -  Old Internet Header Length
  1612.         OMF   -  Old More Fragments flag
  1613.         OTL   -  Old Total Length
  1614.         NFB   -  Number of Fragment Blocks
  1615.         MTU   -  Maximum Transmission Unit
  1616.  
  1617.       Procedure:
  1618.  
  1619.         IF TL =< MTU THEN Submit this datagram to the next step
  1620.              in datagram processing ELSE
  1621.         To produce the first fragment:
  1622.         (1)  Copy the original internet header;
  1623.         (2)  OIHL <- IHL; OTL <- TL; OFO <- FO; OMF <- MF;
  1624.         (3)  NFB <- (MTU-IHL*4)/8;
  1625.         (4)  Attach the first NFB*8 data octets;
  1626.         (5)  Correct the header:
  1627.              MF <- 1;  TL <- (IHL*4)+(NFB*8);
  1628.              Recompute Checksum;
  1629.         (6)  Submit this fragment to the next step in
  1630.              datagram processing;
  1631.         To produce the second fragment:
  1632.         (7)  Selectively copy the internet header (some options
  1633.              are not copied, see option definitions);
  1634.         (8)  Append the remaining data;
  1635.         (9)  Correct the header:
  1636.              IHL <- OIHL - ((length of options not copied)+3)/4;
  1637.              TL <- OTL - NFB*8 - (OIHL-IHL)*4);
  1638.              FO <- OFO + NFB;  MF <- OMF;  Recompute Checksum;
  1639.         (10) Submit this fragment to the fragmentation test; DONE.
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645. [Page 24]                                                               
  1646.  
  1647.  
  1648. December 1979                                                           
  1649.                                                        Internet Protocol
  1650.                                                            Specification
  1651.  
  1652.  
  1653.  
  1654.     Reassembly Procedure
  1655.  
  1656.       For each datagram the buffer identifier is computed as the
  1657.       concatenation of the source, destination, protocol, and
  1658.       identification fields.  If this is a whole datagram (that is both
  1659.       the fragment offset and the more fragments  fields are zero), then
  1660.       any reassembly resources associated with this buffer identifier
  1661.       are released and the datagram is forwarded to the next step in
  1662.       datagram processing.
  1663.  
  1664.       If no other fragment with this buffer identifier is on hand then
  1665.       reassembly resources are allocated.  The reassembly resources
  1666.       consist of a data buffer, a header buffer, a fragment block bit
  1667.       table, a total data length field, and a timer.  The data from the
  1668.       fragment is placed in the data buffer according to its fragment
  1669.       offset and length, and bits are set in the fragment block bit
  1670.       table corresponding to the fragment blocks received.
  1671.  
  1672.       If this is the first fragment (that is the fragment offset is
  1673.       zero)  this header is placed in the header buffer.  If this is the
  1674.       last fragment ( that is the more fragments field is zero) the
  1675.       total data length is computed.  If this fragment completes the
  1676.       datagram (tested by checking the bits set in the fragment block
  1677.       table), then the datagram is sent to the next step in datagram
  1678.       processing; otherwise the timer is set to the maximum of the
  1679.       current timer value and the value of the time to live field from
  1680.       this fragment; and the reassembly routine gives up control.
  1681.  
  1682.       If the timer runs out, the all reassembly resources for this
  1683.       buffer identifier are released.
  1684.  
  1685.       Notation:
  1686.  
  1687.         FO    -  Fragment Offset
  1688.         IHL   -  Internet Header Length
  1689.         MF    -  More Fragments flag
  1690.         TTL   -  Time To Live
  1691.         NFB   -  Number of Fragment Blocks
  1692.         TL    -  Total Length
  1693.         TDL   -  Total Data Length
  1694.         BUFID -  Buffer Identifier
  1695.         RCVBT -  Fragment Received Bit Table
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.                                                                [Page 25]
  1705.  
  1706.  
  1707.                                                            December 1979
  1708. Internet Protocol
  1709. Specification
  1710.  
  1711.  
  1712.  
  1713.       Procedure:
  1714.  
  1715.         (1)  BUFID <- source|destination|protocol|identification;
  1716.         (2)  IF FO = 0 AND MF = 0
  1717.         (3)     THEN IF buffer with BUFID is allocated
  1718.         (4)             THEN flush all reassembly for this BUFID;
  1719.         (5)          Submit datagram to next step; DONE.
  1720.         (6)     ELSE IF no buffer with BUFID is allocated
  1721.         (7)             THEN allocate reassembly resources
  1722.                              with BUFID;
  1723.                              TIMER <- 2 minutes; TDL <- 0;
  1724.         (8)          put data from fragment into data buffer with
  1725.                      BUFID from octet FO*8 to
  1726.                                          octet (TL-(IHL*4))+FO*8;
  1727.         (9)          set RCVBT bits from FO
  1728.                                         to FO+((TL-(IHL*4)+7)/8);
  1729.         (10)         IF MF = 0 THEN TDL <- TL-(IHL*4)+(FO*8)
  1730.         (11)         IF FO = 0 THEN put header in header buffer
  1731.         (12)         IF TDL # 0
  1732.         (13)          AND all RCVBT bits from 0
  1733.                                              to (TDL+7)/8 are set
  1734.         (14)            THEN TL <- TDL+(IHL*4)
  1735.         (15)                 Submit datagram to next step;
  1736.         (16)                 free all reassembly resources
  1737.                              for this BUFID; DONE.
  1738.         (17)         TIMER <- MAX(TIMER,TTL);
  1739.         (18)         give up until next fragment or timer expires;
  1740.         (19) timer expires: flush all reassembly with this BUFID; DONE.
  1741.  
  1742.       In the case that two or more fragments contain the same data
  1743.       either identically or through a partial overlap, this procedure
  1744.       will use the more recently arrived copy in the data buffer and
  1745.       datagram delivered.
  1746.  
  1747.   Identification
  1748.  
  1749.     The choice of the Identifier for a datagram is based on the need to
  1750.     provide a way to uniquely identify the fragments of a particular
  1751.     datagram.  The protocol module assembling fragments judges fragments
  1752.     to belong to the same datagram if they have the same source,
  1753.     destination, protocol, and Identifier.  Thus, the sender must choose
  1754.     the Identifier to be unique for this source, destination pair and
  1755.     protocol for the time the datagram (or any fragment of it) could be
  1756.     alive in the internet.
  1757.  
  1758.     It seems then that a sending protocol module needs to keep a table
  1759.     of Identifiers, one entry for each destination it has communicated
  1760.     with in the last maximum packet lifetime for the internet.
  1761.  
  1762.  
  1763. [Page 26]                                                               
  1764.  
  1765.  
  1766. December 1979                                                           
  1767.                                                        Internet Protocol
  1768.                                                            Specification
  1769.  
  1770.  
  1771.  
  1772.     However, since the Identifier field allows 65,536 different values,
  1773.     some host may be able to simply use unique identifiers independent
  1774.     of destination.
  1775.  
  1776.     It is appropriate for some higher level protocols to choose the
  1777.     identifier. For example, TCP protocol modules may retransmit an
  1778.     identical TCP segment, and the probability for correct reception
  1779.     would be enhanced if the retransmission carried the same identifier
  1780.     as the original transmission since fragments of either datagram
  1781.     could be used to construct a correct TCP segment.
  1782.  
  1783.   Type of Service
  1784.  
  1785.     The type of service (TOS) is for internet service quality selection.
  1786.     The type of service is specified along the abstract parameters
  1787.     precedence, reliability, and speed.  A further concern is the
  1788.     possibility of efficient handling of streams of datagrams.  These
  1789.     abstract parameters are to be mapped into the actual service
  1790.     parameters of the particular networks the datagram traverses.
  1791.  
  1792.     Precedence.  An independent measure of the importance of this
  1793.     datagram.
  1794.  
  1795.     Stream or Datagram.  Indicates if there will be other datagrams from
  1796.     this source to this destination at regular frequent intervals
  1797.     justifying the maintenance of stream processing information.
  1798.  
  1799.     Reliability.  A measure of the level of effort desired to ensure
  1800.     delivery of this datagram.
  1801.  
  1802.     Speed over Reliability.  Indicates the relative importance of speed
  1803.     and reliability when a conflict arises in meeting the pair of
  1804.     requests.
  1805.  
  1806.     Speed.  A measure of the importance of prompt delivery of this
  1807.     datagram.
  1808.  
  1809.     For example, the ARPANET has a priority bit, and a choice between
  1810.     "standard" messages (type 0) and "uncontrolled" messages (type 3),
  1811.     (the choice between single packet and multipacket messages can also
  1812.     be considered a service parameter). The uncontrolled messages tend
  1813.     to be less reliably delivered and suffer less delay.  Suppose an
  1814.     internet datagram is to be sent through the ARPANET.  Let the
  1815.     internet type of service be given as:
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.                                                                [Page 27]
  1823.  
  1824.  
  1825.                                                            December 1979
  1826. Internet Protocol
  1827. Specification
  1828.  
  1829.  
  1830.  
  1831.       Precedence:    5
  1832.       Stream:        0
  1833.       Reliability:   1
  1834.       S/R:           1
  1835.       Speed:         1
  1836.  
  1837.     The mapping of these parameters to those available for the ARPANET
  1838.     would be  to set the ARPANET priority bit on since the Internet
  1839.     priority is in the upper have of its range, to select uncontrolled
  1840.     messages since the speed and reliability requirements are equal and
  1841.     speed is preferred.
  1842.  
  1843.     The following chart presents the recommended mappings from the
  1844.     internet protocol type of service into the service parameters
  1845.     actually available on the ARPANET, the PRNET, and the SATNET:
  1846.  
  1847.       +------------+----------+----------+----------+----------+
  1848.       |Application | INTERNET | ARPANET  | PRNET    | SATNET   |
  1849.       +------------+----------+----------+----------+----------+
  1850.       |TELNET      |S/D:stream| T: 3     | R: ptp   | T: block |
  1851.       |  on        |  R:normal| S: S     | A: no    | D: min   |
  1852.       |   TCP      |S/R:speed |          |          | H: inf   |
  1853.       |            |  S:fast  |          |          | R: no    |
  1854.       +------------+----------+----------+----------+----------+
  1855.       |FTP         |S/D:stream| T: 0     | R: ptp   | T: block |
  1856.       |  on        |  R:normal| S: M     | A: no    | D: normal|
  1857.       |   TCP      |S/R:rlblt |          |          | H: inf   |
  1858.       |            |  S:normal|          |          | R: no    |
  1859.       +------------+----------+----------+----------+----------+
  1860.       |interactive |S/D:strm* | T: 3     | R: ptp   | T: stream|
  1861.       |narrow band |  R:least | S: S     | A: no    | D: min   |
  1862.       |  speech    |  P:speed |          |          | H: short |
  1863.       |            |  S:asap  |          |          | R: no    |
  1864.       +------------+----------+----------+----------+----------+
  1865.       |datagram    |S/D:dtgrm | T: 3 or 0| R:station| T: block |
  1866.       |            |  R:normal| S: S or M| A: no    | D: min   |
  1867.       |            |S/R:speed |          |          | H: short |
  1868.       |            |  S:fast  |          |          | R: no    |
  1869.       +------------+----------+----------+----------+----------+
  1870.        key:    S/D=strm/dtgrm   T=type     R=route  T=type
  1871.                R=reliability    S=size     A=ack    D=delay
  1872.                S/R=speed/rlblt                      H=holding time
  1873.                S=speed                              R=reliability
  1874.                *=requires stream set up
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881. [Page 28]                                                               
  1882.  
  1883.  
  1884. December 1979                                                           
  1885.                                                        Internet Protocol
  1886.                                                            Specification
  1887.  
  1888.  
  1889.  
  1890.   Time to Live
  1891.  
  1892.     The time to live is set by the sender to the maximum time the
  1893.     datagram is allowed to be in the internet system.  If the datagram
  1894.     is in the internet system longer than the time to live, then the
  1895.     datagram should be destroyed.  This field should be decreased at
  1896.     each point that the internet header is processed to reflect the time
  1897.     spent processing the datagram.  Even if no local information is
  1898.     available on the time actually spent, the field should be
  1899.     decremented by 1.  The time is measured in units of seconds (i.e.
  1900.     the value 1 means one second).  Thus, the maximum time to live is
  1901.     255 seconds or 4.25 minutes.
  1902.  
  1903.   Options
  1904.  
  1905.     The options are just that, optional.  That is, the presence or
  1906.     absence of an option is the choice of the sender, but each internet
  1907.     module must implement every option.
  1908.  
  1909.     There can be several options present in the option field.  Every
  1910.     internet module must be able to parse and act on every option.
  1911.  
  1912.     The options might not end on a 32-bit boundary.  The internet header
  1913.     should be filled out with octets of zeros.  The first of these would
  1914.     be interpreted as the end-of-options option, and the remainder as
  1915.     internet header padding.
  1916.  
  1917.   Checksum
  1918.  
  1919.     The internet header checksum is recomputed if the internet header is
  1920.     changed.  For example, a reduction of the time to live, additions or
  1921.     changes to internet options, or due to fragmentation.  This checksum
  1922.     at the internet level is intended to protect the internet header
  1923.     fields from transmission errors.
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.                                                                [Page 29]
  1941.  
  1942.  
  1943.                                                            December 1979
  1944. Internet Protocol
  1945. Specification
  1946.  
  1947.  
  1948.  
  1949. 3.3.  Examples & Scenarios
  1950.  
  1951.   Example 1:
  1952.  
  1953.     This is an example of the minimal data carrying internet datagram:
  1954.  
  1955.                                     
  1956.     0                   1                   2                   3   
  1957.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
  1958.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1959.    |Ver= 4 |IHL= 5 |Type of Service|        Total Length = 21      |
  1960.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1961.    |      Identification = 111     |Flg=0|   Fragment Offset = 0   |
  1962.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1963.    |   Time = 123  |  Protocol = 1 |        header checksum        |
  1964.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1965.    |                         source address                        |
  1966.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1967.    |                      destination address                      |
  1968.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1969.    |     data      |                                                
  1970.    +-+-+-+-+-+-+-+-+                                                
  1971.  
  1972.                        Example Internet Datagram
  1973.  
  1974.                                Figure 4.
  1975.  
  1976.     Note that each tick mark represents one bit position.
  1977.  
  1978.     This is a internet datagram in version 4 of internet protocol; the
  1979.     internet header consists of five 32 bit words, and the total length
  1980.     of the datagram is 21 octets.  This datagram is a complete datagram
  1981.     (not a fragment).
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999. [Page 30]                                                               
  2000.  
  2001.  
  2002. December 1979                                                           
  2003.                                                        Internet Protocol
  2004.                                                            Specification
  2005.  
  2006.  
  2007.  
  2008.   Example 2:
  2009.  
  2010.     In this example, we show first a moderate size internet datagram
  2011.     (552 data octets), then two internet fragments that might result
  2012.     from the fragmentation of this datagram if the maximum sized
  2013.     transmission allowed were 280 octets.
  2014.  
  2015.                                     
  2016.     0                   1                   2                   3   
  2017.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
  2018.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2019.    |Ver= 4 |IHL= 5 |Type of Service|       Total Length = 472      |
  2020.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2021.    |     Identification = 111      |Flg=0|     Fragment Offset = 0 |
  2022.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2023.    |   Time = 123  | Protocol = 6  |        header checksum        |
  2024.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2025.    |                         source address                        |
  2026.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2027.    |                      destination address                      |
  2028.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2029.    |                             data                              |
  2030.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2031.    |                             data                              |
  2032.    \                                                               \
  2033.    \                                                               \
  2034.    |                             data                              |
  2035.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2036.    |             data              |                                
  2037.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                                
  2038.  
  2039.                        Example Internet Datagram
  2040.  
  2041.                                Figure 5.
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.                                                                [Page 31]
  2059.  
  2060.  
  2061.                                                            December 1979
  2062. Internet Protocol
  2063. Specification
  2064.  
  2065.  
  2066.  
  2067.     Now the first fragment that results from splitting the datagram
  2068.     after 256 data octets.
  2069.  
  2070.                                     
  2071.     0                   1                   2                   3   
  2072.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
  2073.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2074.    |Ver= 4 |IHL= 5 |Type of Service|       Total Length = 276      |
  2075.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2076.    |     Identification = 111      |Flg=1|     Fragment Offset = 0 |
  2077.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2078.    |   Time = 119  | Protocol = 6  |        Header Checksum        |
  2079.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2080.    |                         source address                        |
  2081.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2082.    |                      destination address                      |
  2083.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2084.    |                             data                              |
  2085.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2086.    |                             data                              |
  2087.    \                                                               \
  2088.    \                                                               \
  2089.    |                             data                              |
  2090.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2091.    |                             data                              |
  2092.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2093.  
  2094.                        Example Internet Fragment
  2095.  
  2096.                                Figure 6.
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117. [Page 32]                                                               
  2118.  
  2119.  
  2120. December 1979                                                           
  2121.                                                        Internet Protocol
  2122.                                                            Specification
  2123.  
  2124.  
  2125.  
  2126.     And the second fragment.
  2127.  
  2128.                                     
  2129.     0                   1                   2                   3   
  2130.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
  2131.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2132.    |Ver= 4 |IHL= 5 |Type of Service|       Total Length = 216      |
  2133.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2134.    |     Identification = 111      |Flg=0|  Fragment Offset  =  32 |
  2135.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2136.    |   Time = 119  | Protocol = 6  |        Header Checksum        |
  2137.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2138.    |                         source address                        |
  2139.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2140.    |                      destination address                      |
  2141.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2142.    |                             data                              |
  2143.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2144.    |                             data                              |
  2145.    \                                                               \
  2146.    \                                                               \
  2147.    |                             data                              |
  2148.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2149.    |            data               |                                
  2150.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                                
  2151.  
  2152.                        Example Internet Fragment
  2153.  
  2154.                                Figure 7.
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.                                                                [Page 33]
  2177.  
  2178.  
  2179.                                                            December 1979
  2180. Internet Protocol
  2181. Specification
  2182.  
  2183.  
  2184.  
  2185.   Example 3:
  2186.  
  2187.     Here, we show an example of a datagram containing options:
  2188.  
  2189.                                     
  2190.     0                   1                   2                   3   
  2191.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
  2192.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2193.    |Ver= 4 |IHL= 8 |Type of Service|       Total Length = 576      |
  2194.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2195.    |       Identification = 111    |Flg=0|     Fragment Offset = 0 |
  2196.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2197.    |   Time = 123  |  Protocol = 6 |       Header Checksum         |
  2198.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2199.    |                        source address                         |
  2200.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2201.    |                      destination address                      |
  2202.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2203.    | Opt. Code = x | Opt.  Len.= 3 | option value  | Opt. Code = x |
  2204.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2205.    | Opt. Len. = 4 |           option value        | Opt. Code = 1 |
  2206.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2207.    | Opt. Code = y | Opt. Len. = 3 |  option value | Opt. Code = 0 |
  2208.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2209.    |                             data                              |
  2210.    \                                                               \
  2211.    \                                                               \
  2212.    |                             data                              |
  2213.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2214.    |                             data                              |
  2215.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2216.  
  2217.                        Example Internet Datagram
  2218.  
  2219.                                Figure 8.
  2220.  
  2221. 3.4.  Interfaces
  2222.  
  2223.   Internet protocol interfaces on one side to the local network and on
  2224.   the other side to either a higher level protocol or an application
  2225.   program.  In the following, the higher level protocol or application
  2226.   program (or even a gateway program) will be called the "user" since it
  2227.   is using the internet module.  Since internet protocol is a datagram
  2228.   protocol, there is minimal memory or state maintained between datagram
  2229.   transmissions, and each call on the internet protocol module by the
  2230.   user supplies all the necessary information.
  2231.  
  2232.  
  2233.  
  2234.  
  2235. [Page 34]                                                               
  2236.  
  2237.  
  2238. December 1979                                                           
  2239.                                                        Internet Protocol
  2240.                                                            Specification
  2241.  
  2242.  
  2243.  
  2244.   For example, the following two calls satisfy the requirements for the
  2245.   user to internet protocol module communication ("=>" means returns):
  2246.  
  2247.     SEND (dest, TOS, TTL, BufPTR, len, Id, DF, options => result)
  2248.  
  2249.       where:
  2250.  
  2251.         dest = destination address
  2252.         TOS = type of service
  2253.         TTL = time to live
  2254.         BufPTR = buffer pointer
  2255.         len = length of buffer
  2256.         Id  = Identifier
  2257.         DF = Don't Fragment
  2258.         options = option data
  2259.         result = response
  2260.           OK = datagram sent ok
  2261.           Error = error in arguments or local network error
  2262.  
  2263.     RECV (BufPTR => result, source, dest, prot, TOS, len)
  2264.  
  2265.       where:
  2266.  
  2267.         BufPTR = buffer pointer
  2268.         result = response
  2269.           OK = datagram received ok
  2270.           Error = error in arguments
  2271.         source = source address
  2272.         dest = destination address
  2273.         prot = protocol
  2274.         TOS = type of service
  2275.         len = length of buffer
  2276.  
  2277.   When the user sends a datagram, it executes the SEND call supplying
  2278.   all the arguments.  The internet protocol module, on receiving this
  2279.   call, checks the arguments and prepares and sends the message.  If the
  2280.   arguments are good and the datagram is accepted by the local network,
  2281.   the call returns successfully.  If either the arguments are bad, or
  2282.   the datagram is not accepted by the local network, the call returns
  2283.   unsuccessfully.  On unsuccessful returns, a reasonable report should
  2284.   be made as to the cause of the problem, but the details of such
  2285.   reports are up to individual implementations.
  2286.  
  2287.   When a datagram arrives at the internet protocol module from the local
  2288.   network, either there is a pending RECV call from the user addressed
  2289.   or there is not.  In the first case, the pending call is satisfied by
  2290.   passing the information from the datagram to the user.  In the second
  2291.   case, the user addressed is notified of a pending datagram.  If the
  2292.  
  2293.  
  2294.                                                                [Page 35]
  2295.  
  2296.  
  2297.                                                            December 1979
  2298. Internet Protocol
  2299. Specification
  2300.  
  2301.  
  2302.  
  2303.   user addressed does not exist, an error datagram is returned to the
  2304.   sender, and the data is discarded.
  2305.  
  2306.   The notification of a user may be via a pseudo interrupt or similar
  2307.   mechanism, as appropriate in the particular operating system
  2308.   environment of the implementation.
  2309.  
  2310.   A user's RECV call may then either be immediately satisfied by a
  2311.   pending datagram, or the call may be pending until a datagram arrives.
  2312.  
  2313.   An implementation may also allow or require a call to the internet
  2314.   module to indicate interest in or reserve exclusive use of a class of
  2315.   datagrams (e.g., all those with a certain value in the protocol
  2316.   field).
  2317.  
  2318.   
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353. [Page 36]                                                               
  2354.  
  2355.  
  2356. December 1979                                                           
  2357.                                                        Internet Protocol
  2358.  
  2359.  
  2360.  
  2361.                                 GLOSSARY
  2362.  
  2363.  
  2364.  
  2365. 1822
  2366.           BBN Report 1822, "The Specification of the Interconnection of
  2367.           a Host and an IMP".  The specification of interface between a
  2368.           host and the ARPANET.
  2369.  
  2370. ARPANET message
  2371.           The unit of transmission between a host and an IMP in the
  2372.           ARPANET.  The maximum size is about 1012 octets (8096 bits).
  2373.  
  2374. ARPANET packet
  2375.           A unit of transmission used internally in the ARPANET between
  2376.           IMPs. The maximum size is about 126 octets (1008 bits).
  2377.  
  2378. Destination
  2379.           The destination address, an internet header field.
  2380.  
  2381. DF
  2382.           The Don't Fragment bit carried in the flags field.
  2383.  
  2384. Flags
  2385.           An internet header field carrying various control flags.
  2386.  
  2387. Fragment Offset
  2388.           This internet header field indicates where in the internet
  2389.           datagram a fragment belongs.
  2390.  
  2391. header
  2392.           Control information at the beginning of a message, segment,
  2393.           datagram, packet or block of data.
  2394.  
  2395. Identification
  2396.           An internet header field carrying the identifying value
  2397.           assigned by the sender to aid in assembling the fragments of a
  2398.           datagram.
  2399.  
  2400. IHL
  2401.           The internet header field Internet Header Length is the length
  2402.           of the internet header measured in 32 bit words.
  2403.  
  2404. IMP
  2405.           The Interface Message Processor, the packet switch of the
  2406.           ARPANET.
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.                                                                [Page 37]
  2413.  
  2414.  
  2415.                                                            December 1979
  2416. Internet Protocol
  2417. Glossary
  2418.  
  2419.  
  2420.  
  2421. Internet Address
  2422.           A four octet (32 bit) source or destination address consisting
  2423.           of a Network field and a Local Address field.
  2424.  
  2425. internet fragment
  2426.           A portion of the data of an internet datagram with an internet
  2427.           header.
  2428.  
  2429. internet datagram
  2430.           The unit of data exchanged between a pair of internet modules
  2431.           (includes the internet header).
  2432.  
  2433. ARPANET leader
  2434.           The control information on an ARPANET message at the host-IMP
  2435.           interface.
  2436.  
  2437. Local Address
  2438.           The address of a host within a network.  The actual mapping of
  2439.           an internet local address on to the host addresses in a
  2440.           network is quite general, allowing for many to one mappings.
  2441.  
  2442. MF
  2443.           The More-Fragments Flag carried in the internet header flags
  2444.           field.
  2445.  
  2446. module
  2447.           An implementation, usually in software, of a protocol or other
  2448.           procedure.
  2449.  
  2450. more-fragments flag
  2451.           A flag indicating whether or not this internet datagram
  2452.           contains the end of an internet datagram, carried in the
  2453.           internet header Flags field.
  2454.  
  2455. NFB
  2456.           The Number of Fragment Blocks in a the data portion of an
  2457.           internet fragment.  That is, the length of a portion of data
  2458.           measured in 8 octet units.
  2459.  
  2460. octet
  2461.           An eight bit byte.
  2462.  
  2463. Options
  2464.           The internet header Options field may contain several options,
  2465.           and each option may be several octets in length.  The options
  2466.           are used primarily in testing situations, for example to carry
  2467.           timestamps.
  2468.  
  2469.  
  2470.  
  2471. [Page 38]                                                               
  2472.  
  2473.  
  2474. December 1979                                                           
  2475.                                                        Internet Protocol
  2476.                                                                 Glossary
  2477.  
  2478.  
  2479.  
  2480. Padding
  2481.           The internet header Padding field is used to ensure that the
  2482.           data begins on 32 bit word boundary.  The padding is zero.
  2483.  
  2484. Protocol
  2485.           In this document, the next higher level protocol identifier,
  2486.           an internet header field.
  2487.  
  2488. Rest
  2489.           The 3 octet (24 bit) local address portion of an Internet
  2490.           Address.
  2491.  
  2492. RTP
  2493.           Real Time Protocol:  A host-to-host protocol for communication
  2494.           of time critical information.
  2495.  
  2496. Source
  2497.           The source address, an internet header field.
  2498.  
  2499. TCP
  2500.           Transmission Control Protocol:  A host-to-host protocol for
  2501.           reliable communication in internet environments.
  2502.  
  2503. TCP Segment
  2504.           The unit of data exchanged between TCP modules (including the
  2505.           TCP header).
  2506.  
  2507. Total Length
  2508.           The internet header field Total Length is the length of the
  2509.           datagram in octets including internet header and data.
  2510.  
  2511. Type of Service
  2512.           An internet header field which indicates the type (or quality)
  2513.           of service for this internet datagram.
  2514.  
  2515. User
  2516.           The user of the internet protocol.  This may be a higher level
  2517.           protocol module, an application program, or a gateway program.
  2518.  
  2519. Version
  2520.           The Version field indicates the format of the internet header.
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.                                                                [Page 39]
  2531.  
  2532.  
  2533.                                                            December 1979
  2534. Internet Protocol
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589. [Page 40]                                                               
  2590.  
  2591.  
  2592. December 1979                                                           
  2593.                                                        Internet Protocol
  2594.  
  2595.  
  2596.  
  2597.                                REFERENCES
  2598.  
  2599.  
  2600.  
  2601. [1]  Cerf, V., "The Catenet Model for Internetworking," Information
  2602.      Processing Techniques Office, Defense Advanced Research Projects
  2603.      Agency, IEN 48, July 1978.
  2604.  
  2605. [2]  Bolt Beranek and Newman, "Specification for the Interconnection of
  2606.      a Host and an IMP," BBN Technical Report 1822, May 1978 (Revised).
  2607.  
  2608. [3]  Shoch, J., "Inter-Network Naming, Addressing, and Routing,"
  2609.      COMPCON, IEEE Computer Society, Fall 1978.
  2610.  
  2611. [4]  Postel, J., "Address Mappings," IEN 115, USC/Information Sciences
  2612.      Institute, August 1979.
  2613.  
  2614. [5]  Shoch, J., "Packet Fragmentation in Inter-Network Protocols,"
  2615.      Computer Networks, v. 3, n. 1, February 1979.
  2616.  
  2617. [6]  Postel, J., "Assigned Numbers," RFC 758, IEN 117, USC/Information
  2618.      Sciences Institute, August 1979.
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.                                                                [Page 41]
  2649.  
  2650.  
  2651.                                                            December 1979
  2652. Internet Protocol
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707. [Page 42]                                                               
  2708.  
  2709.